package cdp.tarasenko.epamevospring.repository;

import cdp.tarasenko.epamevospring.model.QuarterEvoData;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.data.mongodb.repository.Query;
import org.springframework.stereotype.Repository;

/**
 * @author Oleksandr_Tarasenko
 */
@Repository
public interface EvoDataRepository extends MongoRepository<QuarterEvoData, String> {

    @Query(value = "{'_id' : ?0}")
    QuarterEvoData findEvoDataByQuarter(int quarter);

    /**
     * @return number of quarters in collection
     */
    @Override
    long count();
}
